package com.softer.wxzj.controller;

import com.softer.wxzj.common.util.ShiroUser;
import com.softer.wxzj.entity.SysResource;
import com.softer.wxzj.service.HomeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
/**
 * HomeController class
 * @author zcz
 * @date 2019/1/16
 */
@RestController
@RequestMapping("/home")
@Slf4j
public class HomeController {
    @Autowired
    HomeService homeService;
    @RequestMapping("/getMenu")
    @ResponseBody
    public List<SysResource> getMenu() {
        return homeService.getMenu(ShiroUser.getUserName());
    }
}
